package org.dao.serviceprovide;


import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.classic.Session;


public class DaoUtils {
	
	public Session create(Session session1 , Object obj){
	AnnotationConfiguration config = new AnnotationConfiguration();
	config.addAnnotatedClass((Class)obj);
	config.configure("hibernate.cfg.xml");
    SessionFactory factory =config.buildSessionFactory();
    Session session = factory.getCurrentSession();
    return session ;
	}
	
}
